<template>
  <view>
    <view class="wx-feed-list">
      <drama-feed-list
          id="drama-feed-list"
          autoplay
          bind:videoPlay="onVideoPlay"
          bind:videoPause="onVideoPause"
          bind:videoEnded="onVideoEnded"
          bind:videoError="onVideoError"
          bind:change="onChange"
          @watchFullDrama="onWatchFullDrama"
      ></drama-feed-list>
    </view>
  </view>
</template>

<script>
const PlayerManager = require('../../static/PlayerManager.js');

export default {
  data() {
    return {
      dramaId: null, // 剧目ID
      systemInfo: null,
      tabBarHeight: null
    }
  },
  methods: {
    onWatchFullDrama(row){
      console.log(row)
      PlayerManager.navigateToPlayer({
        srcAppid: row.detail.srcAppid,
        dramaId: row.detail.dramaId,
        // tvId: this.item.id,
      });
      // wx.navigateTo({
      //   url: `plugin-private://wx94a6522b1d640c3b/pages/playlet/playlet?dramaId=${row.detail.dramaId}&srcAppid=${row.detail.srcAppid}&extParam=`
      // });
    },
    onVideoError(e){
      console.log(e)
    }
  },
  onLoad(){
    this.systemInfo = wx.getSystemInfoSync();
    this.tabBarHeight = this.systemInfo.windowHeight - this.systemInfo.statusBarHeight;
  }
}
</script>

<style lang="scss" scoped>
page {
  background-color: #000000;
}
.wx-feed-list {
  width: 100%;
  height: 100vh;
}
</style>
